/*
 * XML Type:  XCriteriaSchemaGroup
 * Namespace: http://www.seedwill.com/xul/criteria
 * Java type: com.seedwill.xul.criteria.XCriteriaSchemaGroup
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.criteria.impl;
/**
 * An XML XCriteriaSchemaGroup(@http://www.seedwill.com/xul/criteria).
 *
 * This is a complex type.
 */
public class XCriteriaSchemaGroupImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.criteria.XCriteriaSchemaGroup
{
    private static final long serialVersionUID = 1L;
    
    public XCriteriaSchemaGroupImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CRITERIASCHEMA$0 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "criteriaSchema");
    private static final javax.xml.namespace.QName DEFAULTCRITERIAEXPRESSION$2 = 
        new javax.xml.namespace.QName("http://www.seedwill.com/xul/criteria", "defaultCriteriaExpression");
    
    
    /**
     * Gets array of all "criteriaSchema" elements
     */
    public com.seedwill.xul.criteria.XCriteriaSchema[] getCriteriaSchemaArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CRITERIASCHEMA$0, targetList);
            com.seedwill.xul.criteria.XCriteriaSchema[] result = new com.seedwill.xul.criteria.XCriteriaSchema[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "criteriaSchema" element
     */
    public com.seedwill.xul.criteria.XCriteriaSchema getCriteriaSchemaArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaSchema target = null;
            target = (com.seedwill.xul.criteria.XCriteriaSchema)get_store().find_element_user(CRITERIASCHEMA$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "criteriaSchema" element
     */
    public int sizeOfCriteriaSchemaArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CRITERIASCHEMA$0);
        }
    }
    
    /**
     * Sets array of all "criteriaSchema" element
     */
    public void setCriteriaSchemaArray(com.seedwill.xul.criteria.XCriteriaSchema[] criteriaSchemaArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(criteriaSchemaArray, CRITERIASCHEMA$0);
        }
    }
    
    /**
     * Sets ith "criteriaSchema" element
     */
    public void setCriteriaSchemaArray(int i, com.seedwill.xul.criteria.XCriteriaSchema criteriaSchema)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaSchema target = null;
            target = (com.seedwill.xul.criteria.XCriteriaSchema)get_store().find_element_user(CRITERIASCHEMA$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(criteriaSchema);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "criteriaSchema" element
     */
    public com.seedwill.xul.criteria.XCriteriaSchema insertNewCriteriaSchema(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaSchema target = null;
            target = (com.seedwill.xul.criteria.XCriteriaSchema)get_store().insert_element_user(CRITERIASCHEMA$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "criteriaSchema" element
     */
    public com.seedwill.xul.criteria.XCriteriaSchema addNewCriteriaSchema()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.criteria.XCriteriaSchema target = null;
            target = (com.seedwill.xul.criteria.XCriteriaSchema)get_store().add_element_user(CRITERIASCHEMA$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "criteriaSchema" element
     */
    public void removeCriteriaSchema(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CRITERIASCHEMA$0, i);
        }
    }
    
    /**
     * Gets the "defaultCriteriaExpression" element
     */
    public java.lang.String getDefaultCriteriaExpression()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEFAULTCRITERIAEXPRESSION$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "defaultCriteriaExpression" element
     */
    public org.apache.xmlbeans.XmlString xgetDefaultCriteriaExpression()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DEFAULTCRITERIAEXPRESSION$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "defaultCriteriaExpression" element
     */
    public void setDefaultCriteriaExpression(java.lang.String defaultCriteriaExpression)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEFAULTCRITERIAEXPRESSION$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DEFAULTCRITERIAEXPRESSION$2);
            }
            target.setStringValue(defaultCriteriaExpression);
        }
    }
    
    /**
     * Sets (as xml) the "defaultCriteriaExpression" element
     */
    public void xsetDefaultCriteriaExpression(org.apache.xmlbeans.XmlString defaultCriteriaExpression)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DEFAULTCRITERIAEXPRESSION$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(DEFAULTCRITERIAEXPRESSION$2);
            }
            target.set(defaultCriteriaExpression);
        }
    }
}
